package com.sztz.utils;

import cn.hutool.core.exceptions.ExceptionUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.*;
import cn.hutool.system.SystemUtil;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sztz.annotation.ForChange;
import com.sztz.constants.CommonConstants;
import lombok.extern.slf4j.Slf4j;

import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.lang.reflect.Field;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * 通用工具类
 * @author yzy
 * @date 2022/4/19 14:05
 */
@Slf4j
public class CommUtils {
    /**
     * 非中文，非单字节字符（英文字母，数字，英文字符），非打印控制符
     */
    private static final String NOT_CHINESE_AND_SINGLE_BYTE_REG = "[^\\u4E00-\\u9FA5|^\\x00-\\x7f]|[\\r\\n\\t\\p{C}]";
    /**
     * 非单字节字符（英文字母，数字，英文字符），非打印控制符
     */
    private static final String NOT_SINGLE_BYTE_CHAR_REG = "[^\\x00-\\x7f]|[\\r\\n\\t\\p{C}]";
    /**
     * 只保留单字节字符（英文字母，数字，英文字符）
     * @return String 新字符串
     * @author yzy
     * @date 2022/06/16 16:41
     */
    public static String justSingleByteCharacter(String text){
        return replaceSpecialChar(NOT_SINGLE_BYTE_CHAR_REG,text);
    }
    /**
     * 只保留中文与单字节字符(英文字母，数字，英文字符）
     * @return String 新字符串
     * @author yzy
     * @date 2022/06/16 16:41
     */
    public static String justChineseAndSingleByteCharacter(String text){
        return replaceSpecialChar(NOT_CHINESE_AND_SINGLE_BYTE_REG,text);
    }
    /**
     * 根据正则替换字符串
     * @param pattern 正则表达式
     * @param content 需要处理的字符串
     * @return String 新字符串
     * @author yzy
     * @date 2022/06/16 16:41
     */
    public static String replaceSpecialChar(String pattern, String content){
        return StrUtil.trimToEmpty(content.replaceAll(pattern,StrUtil.EMPTY));
    }
    /**
     * 生成z开头的三位的字符串编码
     * @return num 需要生成的编码数量
     * @author yzy
     * @date 2022/07/05 11:51
     */
    public static List<String> getRandomCustomerCode(int num){
        String[] secondCharArray = ArrayUtil.reverse(CommonConstants.SHUFFLE_CHAR_ARRAY);
        //组装后两位编码
        List<String> collect = Stream.of(secondCharArray).map(
                item -> Stream.of(secondCharArray).map(three -> StrUtil.concat(Boolean.TRUE, item, three)).collect(Collectors.toList())
        ).flatMap(List::stream).collect(Collectors.toList());
        log.info("collet size={}",collect.size());
        return collect.stream().map(item->StrUtil.concat(Boolean.TRUE,"Z",item)).collect(Collectors.toList()).subList(0,num);
    }
    /**
     * 获取两个bean相关的所有属性变更内容
     * @param newBean 更改前的Bean
     * @param oldBean 更改后的Bean
     * @return List<String> 变更的信息列表
     * @author yzy
     * @date 2022/07/26 16:41
     */
    public static <T> List<String> getChangedFields(T newBean, T oldBean){
        Field[] fields = newBean.getClass().getDeclaredFields();
        return Stream.of(fields).filter(field -> field.isAnnotationPresent(ForChange.class))
                .map(field -> getFieldChangeResult(newBean, oldBean, field)).filter(StrUtil::isNotBlank)
                .collect(Collectors.toList());
    }
    /**
     * 组装bean里对象属性的变更
     * @param newBean 更改前的bean
     * @param oldBean 更改后的bean
     * @param field 属性字段
     * @return String 变更的信息字符串
     * @author yzy
     * @date 2022/07/26 16:41
     */
    private static <T> String getFieldChangeResult(T newBean, T oldBean, Field field) {
        try {
            Object newValue = ReflectUtil.getFieldValue(oldBean, field);
            Object oldValue = ReflectUtil.getFieldValue(newBean, field);
                //输出字段的变更信息
            return ObjectUtil.notEqual(newValue, oldValue)? StrUtil.format("{}: 【从 {} 变更为 {} 】; ", field.getAnnotation(ForChange.class).fieldName(), newValue, oldValue) : StrUtil.EMPTY;
        } catch (Exception e) {
            log.error(ExceptionUtil.stacktraceToString(e));
            return StrUtil.EMPTY;
        }
    }
    /**
     * 从实体类对象获取数据库表名
     * @param tClass 实体对象的class
     * @return String 数据库表名
     * @author yzy
     * @date 2022/07/27 17:04
     */
    public static String getTableNameFromBean(Class<?> tClass){
        return tClass.isAnnotationPresent(TableName.class) ? tClass.getAnnotation(TableName.class).value() : StrUtil.EMPTY;
    }

    /**
     * 生成临时文件
     * @param optType 操作类型
     * @return type 文件类型
     * @author yzy
     * @date 2022/08/01 15:53
     */
    public static File createTempFile(String optType , String type){
        //当前时间戳格式，精确到毫秒
        String strDate = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS").format(LocalDateTime.now());
        //文件类型带.符号，则去掉这个符号
        if(StrUtil.startWith(type,StrUtil.DOT)){
            type = StrUtil.replaceIgnoreCase(type,StrUtil.DOT,StrUtil.EMPTY);
        }
        String dirPath= SystemUtil.getOsInfo().isLinux()?"/tmp":"D:";
        return FileUtil.file(StrUtil.format("{}{}{}_{}.{}",dirPath,StrUtil.SLASH, optType , strDate, type));
    }
    /**
     * 获取所有手机靓号
     * @author yzy
     * @date 2022/08/19 15:15
     */
    public static List<String> getGoodPhoneNumber(){
        String[] phones = getPhones();
        List<String> collect = Stream.of(phones).filter(item -> item.length() == 11).collect(Collectors.toList());
        log.info("collect = {}",collect.size());
        return collect.stream().filter(CommUtils::matchPattern).collect(Collectors.toList());
    }
    /**
     * 获取可选的号码
     * @return String[] 提取出所有手机号
     * @author yzy
     * @date 2022/08/19 15:15
     */
    private static String[] getPhones(){
        String num = "17675448978,0,0,0,1,0,0,0,0,0,0,0,16625402937,0,0,0,1,0,0,0,0,0,0,0,15692450337,0,0,0,1,0,0,0,0,0,0,0,13049367214,0,0,0,1,0,0,1,0,0,0,0,13168061659,0,0,0,1,0,0,0,0,0,0,0,15622849415,0,0,0,1,0,0,1,0,0,0,0,13128814231,0,0,0,1,0,0,1,0,0,0,0,13267090932,0,0,0,1,0,0,0,0,0,0,0,15602483442,0,0,0,1,0,0,1,0,0,0,0,15692458845,0,0,0,1,0,0,1,0,0,0,0,15602486718,0,0,0,1,0,0,0,0,0,0,0,17520481553,0,0,0,1,0,0,0,0,0,0,0,18529077420,0,0,0,1,0,0,1,0,0,0,0,17665326575,0,0,0,1,0,0,0,0,0,0,0,13163705239,0,0,0,1,0,0,0,0,0,0,0,15692459967,0,0,0,1,0,0,0,0,0,0,0,18565797104,0,0,0,1,0,0,1,0,0,0,0,18566768420,0,0,0,1,0,0,1,0,0,0,0,13265548176,0,0,0,1,0,0,0,0,0,0,0,17520497795,0,0,0,1,0,0,0,0,0,0,0,17620428053,0,0,0,1,0,0,0,0,0,0,0,13168750395,0,0,0,1,0,0,0,0,0,0,0,13267094460,0,0,0,1,0,0,1,0,0,0,0,17520493390,0,0,0,1,0,0,0,0,0,0,0,15602487076,0,0,0,1,0,0,0,0,0,0,0,13028822751,0,0,0,1,0,0,0,0,0,0,0,13267090774,0,0,0,1,0,0,1,0,0,0,0,15602466734,0,0,0,1,0,0,1,0,0,0,0,15692451165,0,0,0,1,0,0,0,0,0,0,0,13267094617,0,0,0,1,0,0,1,0,0,0,0,18566212752,0,0,0,1,0,0,0,0,0,0,0,18688742961,0,0,0,1,0,0,0,0,0,0,0,15602482582,0,0,0,1,0,0,0,0,0,0,0,13249805983,0,0,0,1,0,0,0,0,0,0,0,15692453976,0,0,0,1,0,0,0,0,0,0,0,18576449662,0,0,0,1,0,0,0,0,0,0,0,13267093573,0,0,0,1,0,0,0,0,0,0,0,13267095085,0,0,0,1,0,0,0,0,0,0,0,17665324827,0,0,0,1,0,0,1,0,0,0,0,15602489720,0,0,0,1,0,0,0,0,0,0,0,15602480341,0,0,0,1,0,0,1,0,0,0,0,13226879732,0,0,0,1,0,0,0,0,0,0,0,13267093819,0,0,0,1,0,0,0,0,0,0,0,17620425264,0,0,0,1,0,0,1,0,0,0,0,17688742432,0,0,0,1,0,0,1,0,0,0,0,13163746250,0,0,0,1,0,0,0,0,0,0,0,13163727150,0,0,0,1,0,0,0,0,0,0,0,15502046851,0,0,0,1,0,0,0,0,0,0,0,17675496936,0,0,0,1,0,0,0,0,0,0,0,13267096148,0,0,0,1,0,0,1,0,0,0,0,13163708701,0,0,0,1,0,0,0,0,0,0,0,18566230647,0,0,0,1,0,0,1,0,0,0,0,15692456182,0,0,0,1,0,0,0,0,0,0,0,17520490840,0,0,0,1,0,0,1,0,0,0,0,15622846306,0,0,0,1,0,0,0,0,0,0,0,16625146890,0,0,0,1,0,0,0,0,0,0,0,17512036859,0,0,0,1,0,0,0,0,0,0,0,13048817261,0,0,0,1,0,0,0,0,0,0,0,13267093601,0,0,0,1,0,0,0,0,0,0,0,16625115174,0,0,0,1,0,0,1,0,0,0,0,13244893981,0,0,0,1,0,0,0,0,0,0,0,13058128732,0,0,0,1,0,0,0,0,0,0,0,13128812185,0,0,0,1,0,0,0,0,0,0,0,13267094194,0,0,0,1,0,0,1,0,0,0,0,13168704995,0,0,0,1,0,0,1,0,0,0,0,13128814072,0,0,0,1,0,0,1,0,0,0,0,17520496054,0,0,0,1,0,0,1,0,0,0,0,18529578059,0,0,0,1,0,0,0,0,0,0,0,18565737805,0,0,0,1,0,0,0,0,0,0,0,17665384104,0,0,0,1,0,0,1,0,0,0,0,17620427590,0,0,0,1,0,0,0,0,0,0,0,13128812948,0,0,0,1,0,0,1,0,0,0,0,17665325982,0,0,0,1,0,0,0,0,0,0,0,15603027281,0,0,0,1,0,0,0,0,0,0,0,13267090164,0,0,0,1,0,0,1,0,0,0,0,13267093404,0,0,0,1,0,0,1,0,0,0,0,15602443493,0,0,0,1,0,0,1,0,0,0,0,18566762391,0,0,0,1,0,0,0,0,0,0,0,17512093872,0,0,0,1,0,0,0,0,0,0,0,13265893203,0,0,0,1,0,0,0,0,0,0,0,13128818793,0,0,0,1,0,0,0,0,0,0,0,15502040079,0,0,0,1,0,0,0,0,0,0,0,13163702836,0,0,0,1,0,0,0,0,0,0,0,15602483605,0,0,0,1,0,0,0,0,0,0,0,13128817428,0,0,0,1,0,0,1,0,0,0,0,15622846913,0,0,0,1,0,0,0,0,0,0,0,13128743184,0,0,0,1,0,0,1,0,0,0,0,13128938315,0,0,0,1,0,0,0,0,0,0,0,13128907327,0,0,0,1,0,0,0,0,0,0,0,15602486098,0,0,0,1,0,0,0,0,0,0,0,13128813075,0,0,0,1,0,0,0,0,0,0,0,18529505638,0,0,0,1,0,0,0,0,0,0,0,13267091443,0,0,0,1,0,0,1,0,0,0,0,13128819803,0,0,0,1,0,0,0,0,0,0,0,13168065363,0,0,0,1,0,0,0,0,0,0,0,13242037307,0,0,0,1,0,0,0,0,0,0,0,17620493612,0,0,0,1,0,0,0,0,0,0,0,17520479238,0,0,0,1,0,0,0,0,0,0,0,15602487005,0,0,0,1,0,0,0,0,0,0,0,17620341935,0,0,0,1,0,0,0,0,0,0,0";
        String num2="13145845791,0,0,0,1,0,0,0,0,0,0,0,13163727653,0,0,0,1,0,0,0,0,0,0,0,13043422160,0,0,0,1,0,0,0,0,0,0,0,13168704995,0,0,0,1,0,0,1,0,0,0,0,13068747537,0,0,0,1,0,0,0,0,0,0,0,18598067853,0,0,0,1,0,0,0,0,0,0,0,13058074654,0,0,0,1,0,0,1,0,0,0,0,13267097830,0,0,0,1,0,0,0,0,0,0,0,16625144867,0,0,0,1,0,0,1,0,0,0,0,17512090492,0,0,0,1,0,0,1,0,0,0,0,17665329160,0,0,0,1,0,0,0,0,0,0,0,17503017306,0,0,0,1,0,0,0,0,0,0,0,13168725117,0,0,0,1,0,0,0,0,0,0,0,17665320638,0,0,0,1,0,0,0,0,0,0,0,18576440344,0,0,0,1,0,0,1,0,0,0,0,18676382703,0,0,0,1,0,0,0,0,0,0,0,18565685725,0,0,0,1,0,0,0,0,0,0,0,13266517426,0,0,0,1,0,0,1,0,0,0,0,17665388745,0,0,0,1,0,0,1,0,0,0,0,15602488684,0,0,0,1,0,0,1,0,0,0,0,13048952947,0,0,0,1,0,0,1,0,0,0,0,18565898534,0,0,0,1,0,0,1,0,0,0,0,15602482406,0,0,0,1,0,0,1,0,0,0,0,13163755940,0,0,0,1,0,0,1,0,0,0,0,13128817956,0,0,0,1,0,0,0,0,0,0,0,13267097072,0,0,0,1,0,0,0,0,0,0,0,15602487549,0,0,0,1,0,0,1,0,0,0,0,13265448917,0,0,0,1,0,0,0,0,0,0,0,17675449021,0,0,0,1,0,0,0,0,0,0,0,17688701758,0,0,0,1,0,0,0,0,0,0,0,13168721162,0,0,0,1,0,0,0,0,0,0,0,13045865904,0,0,0,1,0,0,1,0,0,0,0,18565893854,0,0,0,1,0,0,1,0,0,0,0,18665859193,0,0,0,1,0,0,0,0,0,0,0,15622849787,0,0,0,1,0,0,0,0,0,0,0,17675448963,0,0,0,1,0,0,0,0,0,0,0,17512096037,0,0,0,1,0,0,0,0,0,0,0,17675449697,0,0,0,1,0,0,0,0,0,0,0,13267020692,0,0,0,1,0,0,0,0,0,0,0,15602473850,0,0,0,1,0,0,0,0,0,0,0,17665240569,0,0,0,1,0,0,0,0,0,0,0,13242447981,0,0,0,1,0,0,0,0,0,0,0,15602482365,0,0,0,1,0,0,0,0,0,0,0,15602449642,0,0,0,1,0,0,1,0,0,0,0,16620814590,0,0,0,1,0,0,1,0,0,0,0,13145902861,0,0,0,1,0,0,0,0,0,0,0,17620447759,0,0,0,1,0,0,0,0,0,0,0,15602446305,0,0,0,1,0,0,0,0,0,0,0,13267090048,0,0,0,1,0,0,1,0,0,0,0,15502047185,0,0,0,1,0,0,0,0,0,0,0,17665329940,0,0,0,1,0,0,1,0,0,0,0,13267068062,0,0,0,1,0,0,0,0,0,0,0,17665388256,0,0,0,1,0,0,0,0,0,0,0,17620344191,0,0,0,1,0,0,1,0,0,0,0,18576428940,0,0,0,1,0,0,1,0,0,0,0,13242904675,0,0,0,1,0,0,1,0,0,0,0,13267097335,0,0,0,1,0,0,0,0,0,0,0,13265447294,0,0,0,1,0,0,1,0,0,0,0,15602445159,0,0,0,1,0,0,0,0,0,0,0,18664300685,0,0,0,1,0,0,0,0,0,0,0,13267095563,0,0,0,1,0,0,0,0,0,0,0,13149931376,0,0,0,1,0,0,0,0,0,0,0,15692452126,0,0,0,1,0,0,0,0,0,0,0,13243879376,0,0,0,1,0,0,0,0,0,0,0,17620361840,0,0,0,1,0,0,1,0,0,0,0,17665241251,0,0,0,1,0,0,0,0,0,0,0,13242952793,0,0,0,1,0,0,0,0,0,0,0,18665827145,0,0,0,1,0,0,1,0,0,0,0,15692458375,0,0,0,1,0,0,0,0,0,0,0,17688547637,0,0,0,1,0,0,0,0,0,0,0,17665490147,0,0,0,1,0,0,1,0,0,0,0,16675441046,0,0,0,1,0,0,1,0,0,0,0,18576408396,0,0,0,1,0,0,0,0,0,0,0,13267092591,0,0,0,1,0,0,0,0,0,0,0,13265447948,0,0,0,1,0,0,1,0,0,0,0,13128814337,0,0,0,1,0,0,1,0,0,0,0,15692459117,0,0,0,1,0,0,0,0,0,0,0,13267091443,0,0,0,1,0,0,1,0,0,0,0,13028844857,0,0,0,1,0,0,1,0,0,0,0,13163754726,0,0,0,1,0,0,1,0,0,0,0,13027961764,0,0,0,1,0,0,1,0,0,0,0,17665320473,0,0,0,1,0,0,1,0,0,0,0,18617049759,0,0,0,1,0,0,0,0,0,0,0,15602479763,0,0,0,1,0,0,0,0,0,0,0,13068742156,0,0,0,1,0,0,0,0,0,0,0,17665327052,0,0,0,1,0,0,0,0,0,0,0,13163758109,0,0,0,1,0,0,0,0,0,0,0,17620324386,0,0,0,1,0,0,1,0,0,0,0,15692451340,0,0,0,1,0,0,1,0,0,0,0,13265545951,0,0,0,1,0,0,0,0,0,0,0,13267094995,0,0,0,1,0,0,1,0,0,0,0,15602487516,0,0,0,1,0,0,0,0,0,0,0,17520496824,0,0,0,1,0,0,1,0,0,0,0,13249864713,0,0,0,1,0,0,1,0,0,0,0,17688768257,0,0,0,1,0,0,0,0,0,0,0,15602488457,0,0,0,1,0,0,1,0,0,0,0,17665388503,0,0,0,1,0,0,0,0,0,0,0,17620353250,0,0,0,1,0,0,0,0,0,0,0,15602485095,0,0,0,1,0,0,0,0,0,0,0,13265549086,0,0,0,1,0,0,0,0,0,0,0";
        String num3="17665217554,0,0,0,1,0,0,1,0,0,0,0,13267098150,0,0,0,1,0,0,0,0,0,0,0,18589025036,0,0,0,1,0,0,0,0,0,0,0,17620343510,0,0,0,1,0,0,0,0,0,0,0,17675443890,0,0,0,1,0,0,0,0,0,0,0,13058168231,0,0,0,1,0,0,0,0,0,0,0,13058162180,0,0,0,1,0,0,0,0,0,0,0,13267098475,0,0,0,1,0,0,1,0,0,0,0,17503019251,0,0,0,1,0,0,0,0,0,0,0,17665304773,0,0,0,1,0,0,1,0,0,0,0,13267094457,0,0,0,1,0,0,1,0,0,0,0,15622844385,0,0,0,1,0,0,1,0,0,0,0,16675528647,0,0,0,1,0,0,1,0,0,0,0,13267022371,0,0,0,1,0,0,0,0,0,0,0,13168708335,0,0,0,1,0,0,0,0,0,0,0,15502048593,0,0,0,1,0,0,0,0,0,0,0,13267092591,0,0,0,1,0,0,0,0,0,0,0,13242416539,0,0,0,1,0,0,0,0,0,0,0,18566721597,0,0,0,1,0,0,0,0,0,0,0,13265797121,0,0,0,1,0,0,0,0,0,0,0,13128818360,0,0,0,1,0,0,0,0,0,0,0,17620485943,0,0,0,1,0,0,1,0,0,0,0,17665387097,0,0,0,1,0,0,0,0,0,0,0,13267092165,0,0,0,1,0,0,0,0,0,0,0,15602486083,0,0,0,1,0,0,0,0,0,0,0,13163751437,0,0,0,1,0,0,1,0,0,0,0,13267025127,0,0,0,1,0,0,0,0,0,0,0,18576727106,0,0,0,1,0,0,0,0,0,0,0,18598067532,0,0,0,1,0,0,0,0,0,0,0,17512033031,0,0,0,1,0,0,0,0,0,0,0,13163759205,0,0,0,1,0,0,0,0,0,0,0,17688542634,0,0,0,1,0,0,1,0,0,0,0,18576408369,0,0,0,1,0,0,0,0,0,0,0,13168701581,0,0,0,1,0,0,0,0,0,0,0,18576442459,0,0,0,1,0,0,1,0,0,0,0,13249803871,0,0,0,1,0,0,0,0,0,0,0,13005447708,0,0,0,1,0,0,0,0,0,0,0,17665328212,0,0,0,1,0,0,0,0,0,0,0,15692451383,0,0,0,1,0,0,0,0,0,0,0,17675462239,0,0,0,1,0,0,0,0,0,0,0,18566761593,0,0,0,1,0,0,0,0,0,0,0,17665325564,0,0,0,1,0,0,1,0,0,0,0,18620367907,0,0,0,1,0,0,0,0,0,0,0,13058155147,0,0,0,1,0,0,1,0,0,0,0,13043426672,0,0,0,1,0,0,0,0,0,0,0,17603059293,0,0,0,1,0,0,0,0,0,0,0,13145844612,0,0,0,1,0,0,1,0,0,0,0,17665327837,0,0,0,1,0,0,0,0,0,0,0,18665892327,0,0,0,1,0,0,0,0,0,0,0,13043422519,0,0,0,1,0,0,0,0,0,0,0,13265870561,0,0,0,1,0,0,0,0,0,0,0,15602486718,0,0,0,1,0,0,0,0,0,0,0,13267091714,0,0,0,1,0,0,1,0,0,0,0,15602439554,0,0,0,1,0,0,1,0,0,0,0,13164750192,0,0,0,1,0,0,0,0,0,0,0,13242442079,0,0,0,1,0,0,0,0,0,0,0,13168722573,0,0,0,1,0,0,0,0,0,0,0,13128964463,0,0,0,1,0,0,1,0,0,0,0,17620349057,0,0,0,1,0,0,0,0,0,0,0,15625268302,0,0,0,1,0,0,0,0,0,0,0,18603075614,0,0,0,1,0,0,1,0,0,0,0,18529514479,0,0,0,1,0,0,1,0,0,0,0,15602488325,0,0,0,1,0,0,0,0,0,0,0,13048879323,0,0,0,1,0,0,0,0,0,0,0,13027985439,0,0,0,1,0,0,1,0,0,0,0,17665303410,0,0,0,1,0,0,1,0,0,0,0,15692458483,0,0,0,1,0,0,1,0,0,0,0,17620472940,0,0,0,1,0,0,1,0,0,0,0,18594278615,0,0,0,1,0,0,0,0,0,0,0,16675341283,0,0,0,1,0,0,0,0,0,0,0,13267095651,0,0,0,1,0,0,0,0,0,0,0,13267092291,0,0,0,1,0,0,0,0,0,0,0,17520497325,0,0,0,1,0,0,0,0,0,0,0,15602482901,0,0,0,1,0,0,0,0,0,0,0,17520494590,0,0,0,1,0,0,1,0,0,0,0,13168069150,0,0,0,1,0,0,0,0,0,0,0,17665382512,0,0,0,1,0,0,0,0,0,0,0,13043422801,0,0,0,1,0,0,0,0,0,0,0,18503051945,0,0,0,1,0,0,1,0,0,0,0,15602487810,0,0,0,1,0,0,0,0,0,0,0,15692457129,0,0,0,1,0,0,0,0,0,0,0,15507537553,0,0,0,1,0,0,0,0,0,0,0,13068742682,0,0,0,1,0,0,0,0,0,0,0,17512037235,0,0,0,1,0,0,0,0,0,0,0,13267101392,0,0,0,1,0,0,0,0,0,0,0,17512033079,0,0,0,1,0,0,0,0,0,0,0,13128815801,0,0,0,1,0,0,0,0,0,0,0,17675443831,0,0,0,1,0,0,0,0,0,0,0,13168706817,0,0,0,1,0,0,0,0,0,0,0,18565893671,0,0,0,1,0,0,0,0,0,0,0,13189749975,0,0,0,1,0,0,0,0,0,0,0,15692456301,0,0,0,1,0,0,0,0,0,0,0,18594247083,0,0,0,1,0,0,0,0,0,0,0,13168703058,0,0,0,1,0,0,0,0,0,0,0,17688531950,0,0,0,1,0,0,0,0,0,0,0,15622849392,0,0,0,1,0,0,0,0,0,0,0,15507583983,0,0,0,1,0,0,0,0,0,0,0,13244726805,0,0,0,1,0,0,0,0,0,0,0,17688548630,0,0,0,1,0,0,0,0,0,0,0,15602483046,0,0,0,1,0,0,1,0,0,0,0";
        String num4="13113682143,0,0,0,1,0,0,1,0,0,0,0,13049382719,0,0,0,1,0,0,0,0,0,0,0,15625234548,0,0,0,1,0,0,1,0,0,0,0,13267095906,0,0,0,1,0,0,0,0,0,0,0,15602481936,0,0,0,1,0,0,0,0,0,0,0,13266712561,0,0,0,1,0,0,0,0,0,0,0,18576623201,0,0,0,1,0,0,0,0,0,0,0,13027959943,0,0,0,1,0,0,1,0,0,0,0,13043429538,0,0,0,1,0,0,0,0,0,0,0,13163751804,0,0,0,1,0,0,1,0,0,0,0,17675412889,0,0,0,1,0,0,0,0,0,0,0,18576440134,0,0,0,1,0,0,1,0,0,0,0,15602485120,0,0,0,1,0,0,0,0,0,0,0,13266750963,0,0,0,1,0,0,0,0,0,0,0,13106545019,0,0,0,1,0,0,0,0,0,0,0,15602487203,0,0,0,1,0,0,0,0,0,0,0,13128814065,0,0,0,1,0,0,1,0,0,0,0,18665823117,0,0,0,1,0,0,0,0,0,0,0,16625167081,0,0,0,1,0,0,0,0,0,0,0,13249806039,0,0,0,1,0,0,0,0,0,0,0,17512095287,0,0,0,1,0,0,0,0,0,0,0,13128919170,0,0,0,1,0,0,0,0,0,0,0,13163759245,0,0,0,1,0,0,1,0,0,0,0,18576441641,0,0,0,1,0,0,1,0,0,0,0,13058040267,0,0,0,1,0,0,0,0,0,0,0,17512035721,0,0,0,1,0,0,0,0,0,0,0,17512037254,0,0,0,1,0,0,1,0,0,0,0,17688707356,0,0,0,1,0,0,0,0,0,0,0,17620348076,0,0,0,1,0,0,0,0,0,0,0,17520494221,0,0,0,1,0,0,1,0,0,0,0,18664396183,0,0,0,1,0,0,0,0,0,0,0,13128819102,0,0,0,1,0,0,0,0,0,0,0,17503011535,0,0,0,1,0,0,0,0,0,0,0,13168725942,0,0,0,1,0,0,1,0,0,0,0,17620479164,0,0,0,1,0,0,1,0,0,0,0,17620324914,0,0,0,1,0,0,1,0,0,0,0,17620346725,0,0,0,1,0,0,0,0,0,0,0,18598042672,0,0,0,1,0,0,0,0,0,0,0,17665328653,0,0,0,1,0,0,0,0,0,0,0,13267092952,0,0,0,1,0,0,0,0,0,0,0,17675448068,0,0,0,1,0,0,0,0,0,0,0,13058143069,0,0,0,1,0,0,0,0,0,0,0,13113603524,0,0,0,1,0,0,1,0,0,0,0,15602919278,0,0,0,1,0,0,0,0,0,0,0,17512033929,0,0,0,1,0,0,0,0,0,0,0,17520496017,0,0,0,1,0,0,0,0,0,0,0,13168069862,0,0,0,1,0,0,0,0,0,0,0,13049413207,0,0,0,1,0,0,0,0,0,0,0,17520453562,0,0,0,1,0,0,0,0,0,0,0,13267096131,0,0,0,1,0,0,0,0,0,0,0,13267097339,0,0,0,1,0,0,0,0,0,0,0,18576719627,0,0,0,1,0,0,0,0,0,0,0,17675448516,0,0,0,1,0,0,0,0,0,0,0,17620488547,0,0,0,1,0,0,1,0,0,0,0,13049842265,0,0,0,1,0,0,0,0,0,0,0,17688546042,0,0,0,1,0,0,1,0,0,0,0,13113624675,0,0,0,1,0,0,1,0,0,0,0,17620477532,0,0,0,1,0,0,0,0,0,0,0,17688701924,0,0,0,1,0,0,1,0,0,0,0,17665327968,0,0,0,1,0,0,0,0,0,0,0,17665328715,0,0,0,1,0,0,0,0,0,0,0,13128813067,0,0,0,1,0,0,0,0,0,0,0,13049372413,0,0,0,1,0,0,1,0,0,0,0,13267028485,0,0,0,1,0,0,1,0,0,0,0,15602481243,0,0,0,1,0,0,1,0,0,0,0,17665322458,0,0,0,1,0,0,1,0,0,0,0,18565725937,0,0,0,1,0,0,0,0,0,0,0,13048846473,0,0,0,1,0,0,1,0,0,0,0,15602443576,0,0,0,1,0,0,0,0,0,0,0,15692454534,0,0,0,1,0,0,1,0,0,0,0,13027951739,0,0,0,1,0,0,0,0,0,0,0,13164753873,0,0,0,1,0,0,0,0,0,0,0,13168707365,0,0,0,1,0,0,0,0,0,0,0,17688708485,0,0,0,1,0,0,1,0,0,0,0,17512098135,0,0,0,1,0,0,0,0,0,0,0,13267029203,0,0,0,1,0,0,0,0,0,0,0,13249806295,0,0,0,1,0,0,0,0,0,0,0,18594275735,0,0,0,1,0,0,0,0,0,0,0,15602480476,0,0,0,1,0,0,1,0,0,0,0,13168067931,0,0,0,1,0,0,0,0,0,0,0,15602446513,0,0,0,1,0,0,0,0,0,0,0,13169948652,0,0,0,1,0,0,0,0,0,0,0,17620341369,0,0,0,1,0,0,0,0,0,0,0,15622871137,0,0,0,1,0,0,0,0,0,0,0,15602483756,0,0,0,1,0,0,0,0,0,0,0,17620446048,0,0,0,1,0,0,1,0,0,0,0,17665324644,0,0,0,1,0,0,1,0,0,0,0,13243769361,0,0,0,1,0,0,0,0,0,0,0,17620349480,0,0,0,1,0,0,1,0,0,0,0,13163759205,0,0,0,1,0,0,0,0,0,0,0,16675446143,0,0,0,1,0,0,1,0,0,0,0,17675415936,0,0,0,1,0,0,0,0,0,0,0,13027933506,0,0,0,1,0,0,0,0,0,0,0,18576743490,0,0,0,1,0,0,1,0,0,0,0,16675447975,0,0,0,1,0,0,0,0,0,0,0,18665896913,0,0,0,1,0,0,0,0,0,0,0,18576614891,0,0,0,1,0,0,1,0,0,0,0,18594272840,0,0,0,1,0,0,1,0,0,0,0,15602482034,0,0,0,1,0,0,1,0,0,0,0,17665325445,0,0,0,1,0,0,1,0,0,0,0";
        String num5="15602483968,0,0,0,1,0,0,0,0,0,0,0,17620441548,0,0,0,1,0,0,1,0,0,0,0,13267092264,0,0,0,1,0,0,1,0,0,0,0,18588410461,0,0,0,1,0,0,1,0,0,0,0,16675443540,0,0,0,1,0,0,1,0,0,0,0,17665329587,0,0,0,1,0,0,0,0,0,0,0,16625136972,0,0,0,1,0,0,0,0,0,0,0,18529074869,0,0,0,1,0,0,1,0,0,0,0,17620346953,0,0,0,1,0,0,0,0,0,0,0,17620477873,0,0,0,1,0,0,0,0,0,0,0,18665821094,0,0,0,1,0,0,1,0,0,0,0,13066856807,0,0,0,1,0,0,0,0,0,0,0,15602482231,0,0,0,1,0,0,0,0,0,0,0,15602488590,0,0,0,1,0,0,0,0,0,0,0,13128813630,0,0,0,1,0,0,0,0,0,0,0,16675445962,0,0,0,1,0,0,0,0,0,0,0,15507523656,0,0,0,1,0,0,0,0,0,0,0,18676381335,0,0,0,1,0,0,0,0,0,0,0,13267095014,0,0,0,1,0,0,1,0,0,0,0,18676346544,0,0,0,1,0,0,1,0,0,0,0,13077832450,0,0,0,1,0,0,1,0,0,0,0,13128815871,0,0,0,1,0,0,0,0,0,0,0,17620456806,0,0,0,1,0,0,0,0,0,0,0,13066857803,0,0,0,1,0,0,0,0,0,0,0,13113628446,0,0,0,1,0,0,1,0,0,0,0,15602488154,0,0,0,1,0,0,1,0,0,0,0,17665327391,0,0,0,1,0,0,0,0,0,0,0,17688926246,0,0,0,1,0,0,1,0,0,0,0,13168063902,0,0,0,1,0,0,0,0,0,0,0,17603055710,0,0,0,1,0,0,0,0,0,0,0,17620485105,0,0,0,1,0,0,0,0,0,0,0,15602914014,0,0,0,1,0,0,1,0,0,0,0,17503016856,0,0,0,1,0,0,0,0,0,0,0,15692457968,0,0,0,1,0,0,0,0,0,0,0,18576488402,0,0,0,1,0,0,1,0,0,0,0,13066947856,0,0,0,1,0,0,0,0,0,0,0,13028840667,0,0,0,1,0,0,0,0,0,0,0,13168065820,0,0,0,1,0,0,0,0,0,0,0,18565899347,0,0,0,1,0,0,1,0,0,0,0,17620376861,0,0,0,1,0,0,0,0,0,0,0,13163727701,0,0,0,1,0,0,0,0,0,0,0,18576440344,0,0,0,1,0,0,1,0,0,0,0,16620849537,0,0,0,1,0,0,0,0,0,0,0,13265823410,0,0,0,1,0,0,1,0,0,0,0,13265541305,0,0,0,1,0,0,0,0,0,0,0,13058135470,0,0,0,1,0,0,1,0,0,0,0,17620446731,0,0,0,1,0,0,0,0,0,0,0,13267098047,0,0,0,1,0,0,1,0,0,0,0,13265443283,0,0,0,1,0,0,0,0,0,0,0,15622847092,0,0,0,1,0,0,0,0,0,0,0,13267099131,0,0,0,1,0,0,0,0,0,0,0,15692456368,0,0,0,1,0,0,0,0,0,0,0,13267093682,0,0,0,1,0,0,0,0,0,0,0,17675446196,0,0,0,1,0,0,0,0,0,0,0,13164750578,0,0,0,1,0,0,0,0,0,0,0,17675443871,0,0,0,1,0,0,0,0,0,0,0,17512031293,0,0,0,1,0,0,0,0,0,0,0,13128813573,0,0,0,1,0,0,0,0,0,0,0,13048867153,0,0,0,1,0,0,0,0,0,0,0,15602480752,0,0,0,1,0,0,0,0,0,0,0,13076900245,0,0,0,1,0,0,1,0,0,0,0,16625170463,0,0,0,1,0,0,1,0,0,0,0,18565893701,0,0,0,1,0,0,0,0,0,0,0,15507586931,0,0,0,1,0,0,0,0,0,0,0,13249801607,0,0,0,1,0,0,0,0,0,0,0,16625184780,0,0,0,1,0,0,1,0,0,0,0,17675446953,0,0,0,1,0,0,0,0,0,0,0,17675443540,0,0,0,1,0,0,1,0,0,0,0,13247605846,0,0,0,1,0,0,1,0,0,0,0,17620485148,0,0,0,1,0,0,1,0,0,0,0,15692459552,0,0,0,1,0,0,0,0,0,0,0,17665320360,0,0,0,1,0,0,0,0,0,0,0,13068749507,0,0,0,1,0,0,0,0,0,0,0,18576740984,0,0,0,1,0,0,1,0,0,0,0,15502049571,0,0,0,1,0,0,0,0,0,0,0,15692454379,0,0,0,1,0,0,1,0,0,0,0,13249826597,0,0,0,1,0,0,0,0,0,0,0,13043406596,0,0,0,1,0,0,0,0,0,0,0,13129537202,0,0,0,1,0,0,0,0,0,0,0,15692452413,0,0,0,1,0,0,1,0,0,0,0,16625144902,0,0,0,1,0,0,1,0,0,0,0,18529075369,0,0,0,1,0,0,0,0,0,0,0,13048971837,0,0,0,1,0,0,0,0,0,0,0,15602447513,0,0,0,1,0,0,0,0,0,0,0,18576722571,0,0,0,1,0,0,0,0,0,0,0,17620447759,0,0,0,1,0,0,0,0,0,0,0,18675549370,0,0,0,1,0,0,0,0,0,0,0,13267098673,0,0,0,1,0,0,0,0,0,0,0,18589023529,0,0,0,1,0,0,0,0,0,0,0,18576442143,0,0,0,1,0,0,1,0,0,0,0,17675443831,0,0,0,1,0,0,0,0,0,0,0,13267165853,0,0,0,1,0,0,0,0,0,0,0,13267098403,0,0,0,1,0,0,1,0,0,0,0,13249805082,0,0,0,1,0,0,0,0,0,0,0,18576633142,0,0,0,1,0,0,1,0,0,0,0,13168708506,0,0,0,1,0,0,0,0,0,0,0,16625134297,0,0,0,1,0,0,1,0,0,0,0,15626505979,0,0,0,1,0,0,0,0,0,0,0,17512038280,0,0,0,1,0,0,0,0,0,0,0,15602484618,0,0,0,1,0,0,1,0,0,0,0";
        String num6="17665230454,0,0,0,1,0,0,1,0,0,0,0,13265542779,0,0,0,1,0,0,0,0,0,0,0,15626505283,0,0,0,1,0,0,0,0,0,0,0,18576405846,0,0,0,1,0,0,1,0,0,0,0,15602481070,0,0,0,1,0,0,0,0,0,0,0,18676791705,0,0,0,1,0,0,0,0,0,0,0,13128816327,0,0,0,1,0,0,0,0,0,0,0,13267026830,0,0,0,1,0,0,0,0,0,0,0,16625145844,0,0,0,1,0,0,1,0,0,0,0,18576404703,0,0,0,1,0,0,1,0,0,0,0,15602481775,0,0,0,1,0,0,0,0,0,0,0,15602433282,0,0,0,1,0,0,0,0,0,0,0,13043425817,0,0,0,1,0,0,0,0,0,0,0,13163752857,0,0,0,1,0,0,0,0,0,0,0,13267092125,0,0,0,1,0,0,0,0,0,0,0,13163752606,0,0,0,1,0,0,0,0,0,0,0,17620346490,0,0,0,1,0,0,1,0,0,0,0,17512036283,0,0,0,1,0,0,0,0,0,0,0,15602437439,0,0,0,1,0,0,1,0,0,0,0,17607613371,0,0,0,1,0,0,0,0,0,0,0,17512033702,0,0,0,1,0,0,0,0,0,0,0,17665322760,0,0,0,1,0,0,0,0,0,0,0,18529518576,0,0,0,1,0,0,0,0,0,0,0,13267090873,0,0,0,1,0,0,0,0,0,0,0,17620340847,0,0,0,1,0,0,1,0,0,0,0,18620313659,0,0,0,1,0,0,0,0,0,0,0,18529568506,0,0,0,1,0,0,0,0,0,0,0,17512031397,0,0,0,1,0,0,0,0,0,0,0,18576447286,0,0,0,1,0,0,0,0,0,0,0,13266593397,0,0,0,1,0,0,0,0,0,0,0,17620449529,0,0,0,1,0,0,0,0,0,0,0,13168708612,0,0,0,1,0,0,0,0,0,0,0,13027975514,0,0,0,1,0,0,1,0,0,0,0,13267099327,0,0,0,1,0,0,0,0,0,0,0,18565734246,0,0,0,1,0,0,1,0,0,0,0,17665323873,0,0,0,1,0,0,0,0,0,0,0,18576407528,0,0,0,1,0,0,0,0,0,0,0,17665461271,0,0,0,1,0,0,0,0,0,0,0,17665320498,0,0,0,1,0,0,1,0,0,0,0,13027908248,0,0,0,1,0,0,1,0,0,0,0,17665328221,0,0,0,1,0,0,0,0,0,0,0,13242447825,0,0,0,1,0,0,0,0,0,0,0,13249801906,0,0,0,1,0,0,0,0,0,0,0,16675443845,0,0,0,1,0,0,1,0,0,0,0,13267097962,0,0,0,1,0,0,0,0,0,0,0,17603085263,0,0,0,1,0,0,0,0,0,0,0,13028848127,0,0,0,1,0,0,0,0,0,0,0,17675490978,0,0,0,1,0,0,0,0,0,0,0,17512032781,0,0,0,1,0,0,0,0,0,0,0,13163700537,0,0,0,1,0,0,0,0,0,0,0,15692456145,0,0,0,1,0,0,1,0,0,0,0,17688716983,0,0,0,1,0,0,0,0,0,0,0,13058166272,0,0,0,1,0,0,0,0,0,0,0,18529569801,0,0,0,1,0,0,0,0,0,0,0,17675462038,0,0,0,1,0,0,0,0,0,0,0,13077843329,0,0,0,1,0,0,0,0,0,0,0,15602447069,0,0,0,1,0,0,0,0,0,0,0,13168709376,0,0,0,1,0,0,0,0,0,0,0,18529530452,0,0,0,1,0,0,1,0,0,0,0,13168707102,0,0,0,1,0,0,0,0,0,0,0,13043421807,0,0,0,1,0,0,0,0,0,0,0,18529527389,0,0,0,1,0,0,0,0,0,0,0,13267095916,0,0,0,1,0,0,0,0,0,0,0,13163705375,0,0,0,1,0,0,0,0,0,0,0,15602483605,0,0,0,1,0,0,0,0,0,0,0,15602482409,0,0,0,1,0,0,1,0,0,0,0,17503075871,0,0,0,1,0,0,0,0,0,0,0,17512033271,0,0,0,1,0,0,0,0,0,0,0,15602487291,0,0,0,1,0,0,0,0,0,0,0,16625196094,0,0,0,1,0,0,1,0,0,0,0,13267091342,0,0,0,1,0,0,1,0,0,0,0,13164768310,0,0,0,1,0,0,0,0,0,0,0,13267095647,0,0,0,1,0,0,1,0,0,0,0,18676389606,0,0,0,1,0,0,0,0,0,0,0,15602436152,0,0,0,1,0,0,0,0,0,0,0,13265542061,0,0,0,1,0,0,0,0,0,0,0,17665322565,0,0,0,1,0,0,0,0,0,0,0,17688736791,0,0,0,1,0,0,0,0,0,0,0,13113847359,0,0,0,1,0,0,0,0,0,0,0,17665327916,0,0,0,1,0,0,0,0,0,0,0,13025425509,0,0,0,1,0,0,0,0,0,0,0,13267097196,0,0,0,1,0,0,0,0,0,0,0,18566715694,0,0,0,1,0,0,1,0,0,0,0,13163700435,0,0,0,1,0,0,1,0,0,0,0,16625204285,0,0,0,1,0,0,1,0,0,0,0,17665389202,0,0,0,1,0,0,0,0,0,0,0,13267064191,0,0,0,1,0,0,1,0,0,0,0,13267091902,0,0,0,1,0,0,0,0,0,0,0,17675443936,0,0,0,1,0,0,0,0,0,0,0,17665328649,0,0,0,1,0,0,1,0,0,0,0,13267094373,0,0,0,1,0,0,1,0,0,0,0,15602436764,0,0,0,1,0,0,1,0,0,0,0,17665493561,0,0,0,1,0,0,0,0,0,0,0,13027959943,0,0,0,1,0,0,1,0,0,0,0,13267095962,0,0,0,1,0,0,0,0,0,0,0,15507525197,0,0,0,1,0,0,0,0,0,0,0,13128831962,0,0,0,1,0,0,0,0,0,0,0,18576407679,0,0,0,1,0,0,0,0,0,0,0,13169903985,0,0,0,1,0,0,0,0,0,0,0,13043495793,0,0,0,1,0,0,0,0,0,0,0";
        String[] split = num.split(StrUtil.COMMA);
        String[] split2 = num2.split(StrUtil.COMMA);
        String[] split3 = num3.split(StrUtil.COMMA);
        String[] split4 = num4.split(StrUtil.COMMA);
        String[] split5 = num5.split(StrUtil.COMMA);
        String[] split6 = num6.split(StrUtil.COMMA);
        return ArrayUtil.addAll(split, split2,split3,split4,split5,split6);
    }
    /**
     * 判断输入的手机号码是不是靓号
     * @param item 手机号码
     * @return boolean 是否是靓号
     * @author yzy
     * @date 2022/08/19 15:15
     */
    private static boolean matchPattern(String item){
        List<String> levitPatterns =  new ArrayList<>();
        /**
         * 只能进行全字符串回文判断的正则 levitPatterns.add("^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?\\9\\8\\7\\6\\5\\4\\3\\2\\1$");
         */
        //ABCDABCD
        levitPatterns.add("^(\\d)(\\d)(\\d)(\\d)\\1\\2\\3\\4$");
        //4位递增并重复
        levitPatterns.add("(?:0(?=1)|1(?=2)|2(?=3)|3(?=4)|4(?=5)|5(?=6)|6(?=7)|7(?=8)|8(?=9)){3}\\d(?:0(?=1)|1(?=2)|2(?=3)|3(?=4)|4(?=5)|5(?=6)|6(?=7)|7(?=8)|8(?=9)){3}\\d");
        // AABB
        levitPatterns.add("^\\d*(\\d)\\1(\\d)\\2\\d*$");
        // AAABBB
        levitPatterns.add("^\\d*(\\d)\\1\\1(\\d)\\2\\2\\d*$");
        // ABABAB
        levitPatterns.add("^(\\d)(\\d)\\1\\2\\1\\2\\1\\2$");
        // ABCABC
        levitPatterns.add("^(\\d)(\\d)(\\d)\\1\\2\\3$");
        //ABCDABC
        levitPatterns.add("(?:0(?=1)|1(?=2)|2(?=3)|3(?=4)|4(?=5)|5(?=6)|6(?=7)|7(?=8)|8(?=9)){2}\\d[\\d](?:0(?=1)|1(?=2)|2(?=3)|3(?=4)|4(?=5)|5(?=6)|6(?=7)|7(?=8)|8(?=9)){2}\\d");
        // AAA 结尾
        levitPatterns.add("\\d{7}([0-9])(?!\1)([0-9])\2{2}");
        // AABB 结尾
        levitPatterns.add("\\d{6}([0-9])(?!\\1)([0-9])\\2(?!\\2)([0-9])\\3");
        //ABAB 结尾
        levitPatterns.add("\\d{7}([0-9])(?!\\1)([0-9])\\1\\2");
        //AABBCC
        levitPatterns.add("([\\d])\\1{1}([\\d])\\2{1}([\\d])\\3{1}");
        //ABBABB
        levitPatterns.add("^(\\d)(\\d)\\2\\1\\2\\2$");
        //ABBCABB
        levitPatterns.add("(([\\d]){1,}([\\d]){1,})\\1{1,}");
        //AABBB
        levitPatterns.add("([\\d])\\1{1,}([\\d])\\2{2,}");
        // 3位以上 位递增或者递减（7890也是递增）
        levitPatterns.add("(?:(?:0(?=1)|1(?=2)|2(?=3)|3(?=4)|4(?=5)|5(?=6)|6(?=7)|7(?=8)|8(?=9)|9(?=0)){2,}|(?:0(?=9)|9(?=8)|8(?=7)|7(?=6)|6(?=5)|5(?=4)|4(?=3)|3(?=2)|2(?=1)|1(?=0)){2,})\\d");
        //六位递增或者递减
        levitPatterns.add("(?:(?:0(?=1)|1(?=2)|2(?=3)|3(?=4)|4(?=5)|5(?=6)|6(?=7)|7(?=8)|8(?=9)){5}|(?:9(?=8)|8(?=7)|7(?=6)|6(?=5)|5(?=4)|4(?=3)|3(?=2)|2(?=1)|1(?=0)){5})\\d");
        //匹配4-9位连续的数字
        levitPatterns.add("(?:(?:0(?=1)|1(?=2)|2(?=3)|3(?=4)|4(?=5)|5(?=6)|6(?=7)|7(?=8)|8(?=9)){3,}|(?:9(?=8)|8(?=7)|7(?=6)|6(?=5)|5(?=4)|4(?=3)|3(?=2)|2(?=1)|1(?=0)){3,})\\d");
        return levitPatterns.stream().anyMatch(regStr-> ReUtil.isMatch(regStr,item));
    }

    /***
     * 通过HttpServletResponse输出json格式
     * @param response HttpServletResponse
     * @param jsonMsg 需要输出的JSON数据
     * @author yzy
     * @date 2023/3/22 16:23
     */
    public static void responseJsonMessage(HttpServletResponse response, String jsonMsg){
        response.setHeader("Access-Control-Allow-Origin", "*");
        response.setHeader("Cache-Control", "no-cache");
        response.setCharacterEncoding("UTF-8");
        response.setContentType("application/json; charset=utf-8");
        try( PrintWriter writer = response.getWriter()){
            writer.println(jsonMsg);
            writer.flush();
        } catch (IOException e) {
            log.error("responseJsonMessage exception:{}", ExceptionUtil.stacktraceToString(e));
        }
    }
}
